package org.zh.test;

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;

public class StaticPub {
    public static final HttpClient httpClient_1_1 = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1)
            .followRedirects(HttpClient.Redirect.NORMAL).connectTimeout(Duration.ofSeconds(20)).build();

    public static final HttpResponse.BodyHandler<String> handler = HttpResponse.BodyHandlers.ofString();

    public static HttpRequest getRequest(String path) {
        return HttpRequest.newBuilder().GET().uri(URI.create(path)).build();
    }
}
